<template>


  <nav class="navbar navbar-av">
    <div class="container-fluid">
      <!-- Brand and toggle get grouped for better mobile display -->
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="{% url 'index' %}">TaskSaas</a>
      </div>

      <!-- Collect the nav links, forms, and other content for toggling -->
      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
        <ul class="nav navbar-nav">
<!--          {% all_project_list request %}-->
<!--          {#                {% all_glory_list request %}#}-->

<!--          {% if request.web.project %}-->
<!--          {% manage_menu_list request %}-->
<!--          {% endif %}-->
        </ul>
        <ul class="nav navbar-nav navbar-right">
<!--          {% if request.web.project %}-->
<!--          {% right_side_manage_menu_list request %}-->
<!--          {% endif %}-->

          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
               aria-expanded="false">{{ request.web.user.username }}<span class="caret"></span></a>
            <ul class="dropdown-menu">
              <li><a href="{% url 'index' %}">首 页</a></li>
              <li role="separator" class="divider"></li>
              <li><a href="{% url 'profile' %}">用户设置</a></li>
              <li role="separator" class="divider"></li>
              <li><a href="{% url 'sys_setting' %}">系统设置</a></li>
              <li role="separator" class="divider"></li>
              <li><a href="{% url 'logout' %}">用户注销</a></li>
            </ul>
          </li>

        </ul>
      </div>
    </div>
  </nav>

  <script>
    const mytaskTriggerKey = "mytaskTrigger" + '{{ request.web.user.id }}' + '_' + '{{ request.web.project.id }}'
    console.log('mytaskTriggerKey', mytaskTriggerKey)

    function storageTriggerInit() {
      let item = localStorage.getItem(mytaskTriggerKey);
      console.log("trigger", item)
      if (!item) {
        item = 'off'
        localStorage.setItem(mytaskTriggerKey, item);
      }
      if (item == "on") {
        $('input[type="checkbox"]').prop('checked', true);
      } else {
        $('input[type="checkbox"]').prop('checked', false);
      }
    }

    storageTriggerInit()

    function showCalendar() {
      alert('链接钉钉、企业微信等 团队考勤展示等')
    }

  </script>

</template>

<script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.3/echarts.min.js"
        integrity="sha512-EmNxF3E6bM0Xg1zvmkeYD3HDBeGxtsG92IxFt1myNZhXdCav9MzvuH/zNMBU1DmIPN6njrhX1VTbqdJxQ2wHDg=="
        crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!--  <script src="{% static 'web/plugin/bootstrap/js/bootstrap.min.js' %}"></script>-->
<script>
import layui from '/src/assets/layui/layui'

export default {
  name: "Dashboard"
}
</script>

<style scoped>
@import "src/assets/styles/manage.css";
.navbar-av {
  border-radius: 0;
}

.error-msg {
  color: red;
  position: absolute;
  font-size: 13px;
}
</style>
